﻿<?xml version="1.0" encoding="utf-8"?>
<!--
        作者：          chi.zhang
        更新时间：      20141230
        用途：          生成应用服务器的function.sdf
-->
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:output method="text" indent="no" encoding="utf-8" byte-order-mark="no"/>  
	<xsl:template match="/">
	<xsl:variable name="metas" select="document('../model/0101_metadataTypeDefine.xml')"/>
	<xsl:result-document encoding="utf-8" method="text" href="./generate/appserver/function_pd.sdf">/*当前库接口文件*/<xsl:for-each select="Functions/Function">

FUNCTION <xsl:value-of select="@func_no"/> Description  "<xsl:value-of select="@func_name"/>" <xsl:if test="@reqlevel!=''"> reqlevel <xsl:value-of select="@reqlevel"/></xsl:if><xsl:if test="@isPush='true'">push 1</xsl:if> 
<xsl:for-each select="Request">
/*输入:<xsl:for-each select="Field">
<xsl:variable name="name" select="@name"/>
<xsl:value-of select="$metas//Metadatas/*[@typename=$name]/@label"/><xsl:if test="position()!=last()">,</xsl:if>
</xsl:for-each>*/
INPUT:SBANK_ACC,SBANK_ACC2,SCUSTTYPES,VSVARSTR0<xsl:for-each select="Field">,<xsl:value-of select="@cpack"/></xsl:for-each>
</xsl:for-each>
/*输出:<xsl:for-each select="Response">
<xsl:for-each select="Field">
<xsl:variable name="name" select="@name"/>
<xsl:value-of select="$metas//Metadatas/*[@typename=$name]/@label"/><xsl:if test="position()!=last()">,</xsl:if>
</xsl:for-each></xsl:for-each>*/
OUTPUT:<xsl:for-each select="Response">
<xsl:for-each select="Field"><xsl:value-of select="@cpack"/><xsl:if test="position()!=last()">,</xsl:if></xsl:for-each>
</xsl:for-each>
</xsl:for-each>
&#160;</xsl:result-document>
	</xsl:template>  
</xsl:stylesheet>